package com.cdd.role.controller;

import com.cdd.role.service.RolePermissionService;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzl
 * @since 2022-09-03
 */
@RestController
@RequestMapping("/role/role")
public class RolePermissionController {
    @Autowired
    private RolePermissionService rolePermissionService;
    //根据角色id分配权限
    @PostMapping("/updatePermission/{roleId}")
    public CommonResult updatePermission(@PathVariable String roleId,@RequestBody List<String> menuids){
        System.out.println(roleId+menuids);
       return rolePermissionService.updateRolePermission(roleId,menuids);
    }
}
